package com.itheima.controller;

import com.itheima.pojo.OperateLog;
import com.itheima.pojo.PageResult;
import com.itheima.pojo.Result;
import com.itheima.service.OperateLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
 * 操作日志
 */
@RestController
@RequestMapping("/log")
public class OperateLogController {
    @Autowired
    private OperateLogService logService;

    /**
     * 日志查询
     * @param page
     * @param pageSize
     * @return
     */
    @GetMapping("/page")
    public Result log(@RequestParam(defaultValue = "1") Integer page,
                      @RequestParam(defaultValue = "10") Integer pageSize) {
        PageResult<OperateLog> pageResult =logService.PageLog(page, pageSize);
        return Result.success(pageResult);

    }
}
